package com.sas.domain;

import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;

import org.springframework.util.Assert;

@Entity
public class Vendor extends Subject {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@ManyToMany(mappedBy = "vendors")
	private Set<Article> articles;
	
	@OneToMany(mappedBy = "vendor")
	private Set<Flow> history;
	
	@OneToMany
	@JoinColumn(name = "vendorId")
	private Set<ArticleOfVendorCode> articlesOfVendors;
	
	@OneToMany
	@JoinColumn(name = "vendorId")
	private Set<Seller> sellers;
		
	public Vendor () {
	}


	public Set<Article> getArticles() {
		return articles;
	}

	public void setArticles(Set<Article> articles) {
		Assert.notNull(articles);
		this.articles = articles;
	}

	public void setSellers(Set<Seller> sellers) {
		Assert.notNull(sellers);
		this.sellers = sellers;
	}

	public Set<Seller> getSellers() {
		return sellers;
	}

	public void setArticlesOfVendors(Set<ArticleOfVendorCode> articlesOfVendors) {
		Assert.notNull(articlesOfVendors);
		this.articlesOfVendors = articlesOfVendors;
	}

	public Set<ArticleOfVendorCode> getArticlesOfVendors() {
		return articlesOfVendors;
	}


	public void setHistory(Set<Flow> history) {
		this.history = history;
	}


	public Set<Flow> getHistory() {
		return history;
	}
}
